package com.mx.tool.form.window.website;

import com.mx.tool.util.NotifyUtil;

import java.awt.*;
import java.io.IOException;
import java.net.URI;

/**
 * @Author: 徐建鹏.
 * @create: 2021-11-11 14:15
 * @Description:
 */
public class WebsiteWindow {

    protected void openUrl(String url) {
        Desktop desktop = Desktop.getDesktop();
        if (desktop.isSupported(Desktop.Action.BROWSE)) {
            try {
                desktop.browse(URI.create(url));
            } catch (IOException ex) {
                NotifyUtil.error("没有找到浏览器");
                ex.printStackTrace();
            }
        }
    }
}
